package com.study.lxy.newbatis.sqlSession;

import java.lang.reflect.Proxy;

public class MySqlSession {

    @SuppressWarnings("unchecked")
    public <T> T getMapper(Class<T> clas){
        //动态代理调用
        return (T) Proxy.newProxyInstance(clas.getClassLoader(),new Class[]{clas},
                new MyMapperProxy());
    }
}
